package seu.xml.analysis;
/**
 * 解析UML图中每个元素element
 * @author cy
 *
 */
public class Element {
	private String type;
	private int x;
	private int y;
	private int w;
	private int h;
	private String panel_attributes;
	private String additional_attributes;
	private String[] panel_attributes_line;
	public Element(){
		type = null;
		x = -1;
		y = -1;
		w = -1;
		h = -1;
		panel_attributes = null;
		additional_attributes = null;
		panel_attributes_line = null;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public int getX() {
		return x;
	}
	public void setX(int x) {
		this.x = x;
	}
	public int getY() {
		return y;
	}
	public void setY(int y) {
		this.y = y;
	}
	public int getW() {
		return w;
	}
	public void setW(int w) {
		this.w = w;
	}
	public int getH() {
		return h;
	}
	public void setH(int h) {
		this.h = h;
	}
	public String getPanel_attributes() {
		return panel_attributes;
	}
	public String getPanel_attributes(int i) {
		if(panel_attributes==null) return null;
		if(panel_attributes_line == null){
			panel_attributes_line = panel_attributes.split("\\n");
		}
		if(i==1&&i<=panel_attributes_line.length) return panel_attributes_line[i-1].replaceAll("\\W+", "");
		else if(i==2 &&i<=panel_attributes_line.length) return panel_attributes_line[i-1];
		return panel_attributes;
	}
	public void setPanel_attributes(String panel_attributes) {
		this.panel_attributes = panel_attributes;
	}
	public String getAdditional_attributes() {
		return additional_attributes;
	}
	public void setAdditional_attributes(String additional_attributes) {
		this.additional_attributes = additional_attributes;
	}
	
}
